<?php

namespace App\Http\Controllers\Frontend;

use App\Category;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class BaseController extends Controller
{
    public function __construct()
    {
        // 查询栏目
        $categories = Category::where('parent_id', 0)->where('belongs_to', 'post')->orderBy('order')->limit(5)->get();
        view()->share('categories', $categories);
    }
}
